package io.renren.modules.generator.service.impl;

import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.generator.dao.InOrderDao;
import io.renren.modules.generator.entity.InOrderEntity;
import io.renren.modules.generator.service.InOrderService;


@Service("inOrderService")
public class InOrderServiceImpl extends ServiceImpl<InOrderDao, InOrderEntity> implements InOrderService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<InOrderEntity> page = this.selectPage(
                new Query<InOrderEntity>(params).getPage(),
                new EntityWrapper<InOrderEntity>().like(params.containsKey("orderNo"), "order_no", params.get("orderNo") + "").orderBy("order_no", false)
        );

        return new PageUtils(page);
    }

}
